package exception;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args)
            throws IOException {
//将一个Person对象写入文件person.obj
        String name = "苍#null";
        int age = 18;
        String gender = "女";
        String[] otherInfo = {"是一名台词不多的演员"," 来自岛国"," 爱好写大字"," 广大男性同胞的启蒙老师"};
                Person p = new
                Person(age, name, gender, otherInfo);
        System.out.println(p);
        FileOutputStream      fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(p);
        System.out.println("写出完毕!");
}
    }
